package com.bwie.controller;

import com.bwie.mapper.TbProdInfoMapper;
import com.bwie.pojo.TbProdInfo;
import com.bwie.service.TbProdInfoService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 牛毅
 * @version 1.0
 * @date 2025/7/25
 * @description TODO
 */
@RestController
@RequestMapping("/prod/prodInfo")
public class ProdInfoController {
    @Autowired
    TbProdInfoService tbProdInfoService;

    /**
     * @author: LiChong
     * @description:
     * @params: 商品详情列表查询
     * @return: com.bwie.utils.R
     * @date: 2025/7/23 17:07
     */
    @ApiOperation("商品详情列表查询")
    @PostMapping("selectProdInfo")
    public R selectProdInfo(){
        return tbProdInfoService.selectProdInfo();
    }

    /**
     * @author: LiChong
     * @description:
     * @params: 添加商品SKU
     * @return:
     * @date: 2025/7/25 8:44
     */
    @ApiOperation("添加商品SKU")
    @PostMapping("/addProdInfo")
    public R addProdInfo(@RequestBody TbProdInfo prodInfo){
        return tbProdInfoService.addProdInfo(prodInfo);
    }

    /**
     * @author: LiChong
     * @description:
     * @params: 根据商品查询订单详情详情
     * @return:
     * @date: 2025/7/25 9:19
     */
    @ApiOperation("根据商品查询订单详情详情")
    @PostMapping("/selectProdInfoByProdId/{prodId}")
    public R selectProdInfoByProdId(@PathVariable(name = "prodId")Integer prodId, @RequestBody PageInfoVo pageInfoVo){
        return tbProdInfoService.selectProdInfoByProdId(prodId,pageInfoVo);
    }


}
